import port from '.././public/'
import {
    GET_AppointmentDetail_Success
} from './actionTypes';
// 预约的按id获取页面
const getAppointmentDetailSuccess = data =>{
    return{
        type: GET_AppointmentDetail_Success,
        data
    }
};

export const getAppointmentDetail=id=>{
    let url =  port + '/card/subscribe/'+id;
    return dispath=>{
        return fetch(url)
            .then(res => {
                console.log(res.status)
                return res.json()
            })
            .then(data => {
                console.log('getAppointmentDetail')
                console.log(data.data)
                dispath(getAppointmentDetailSuccess(data.data))
            })
            .catch(e =>{
                console.log(e)
            })
    }
}